'''
Created on 11.12.2012

@author: MBikman
'''
import main as Main
import sys
import traceback

def main():
    heavyPartCache = None    
    while True:
        if not heavyPartCache:
            heavyPartCache = Main.heavyPart()
        try:
            Main.lightPart(heavyPartCache)
        except Exception as e:
            print e
            traceback.print_exc()
        print "Press ENTER to re-run the script, CTRL-C to exit"
        sys.stdin.readline()
        reload(Main)
        

if __name__ == "__main__":
    main()
    
    